package com.yugao.fintech.antelope.infra.weixin.mp.manager;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yugao.fintech.antelope.infra.weixin.mp.mapper.MpMenuMapper;
import com.yugao.fintech.antelope.infra.weixin.mp.model.entity.MpMenu;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

/**
 * 公众号菜单 仓储层
 *

 */
@Slf4j
@Repository
public class MpMenuManager extends ServiceImpl<MpMenuMapper, MpMenu>
    implements IService<MpMenu> {

    public MpMenu getByAppIdAndMenuKey(String appId, String menuKey) {
        LambdaQueryWrapper<MpMenu> lqw = MpMenu.lqw().eq(MpMenu::getMpAppId, appId)
                .eq(MpMenu::getMenuKey, menuKey);
        return this.getOne(lqw);
    }
}
